﻿using System;
using System.Collections.Generic;

namespace School
{
    class Course
    {
        private Dictionary<int, Student> enlistedStudents;

        public Course() 
        {
            this.enlistedStudents = new Dictionary<int, Student>();
        }

        public bool AddStudent(Student newStudent) 
        {
            if (enlistedStudents.ContainsKey(newStudent.FacultyNumber)) 
            {
                throw new ArgumentOutOfRangeException("This student is already enroled in this course");
            }
            if (enlistedStudents.Count > 30) 
            {
                throw new ArgumentException("The course is full");
            }

            enlistedStudents.Add(newStudent.FacultyNumber, newStudent);
            return true;
        }
    }
}
